Skip to content

[block_pass] Relink successors after block becomes empty#20909

Open
iluuu1994 wants to merge 1 commit intophp:masterfrom
iluuu1994:gh-20850-follow-up
Open

[block_pass] Relink successors after block becomes empty#20909
iluuu1994 wants to merge 1 commit intophp:masterfrom
iluuu1994:gh-20850-follow-up

Conversation

@iluuu1994
Copy link
Copy Markdown
Member

Improvement of GH-20850 for master only.

if (recompute_successors) {
for (b = blocks; b < end; b++) {
for (int s = 0; s < b->successors_count; s++) {
get_target_block(&cfg, b, s, &opt_count);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible that get_target_block() will update successors to a non-target block. I'm wondering if this could become an issue. Should we propagate the ZEND_BB_TARGET flag to the new successor?

Copy link
Copy Markdown
Member Author

@iluuu1994 iluuu1994 Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, good catch. get_target_block() should probably take care of that. Edit: Ah, I misunderstood. Yeah you're correct, this needs fixing.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, that your previous fix relays on ZEND_BB_TARGET flag, that may be not accurately set for empty blocks and their followers. Updating it lazily in get_target_block() won't work for all cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants